﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    abstract public class Creator
    {
            public abstract AbstractSweet FactoryMethod();  
	        public abstract AbstractSweet FactoryMethod(string name);  
	        public abstract AbstractSweet FactoryMethod(string name, double weight);
    }

    public class CaramelCreator: Creator
    {
        public override AbstractSweet FactoryMethod()
        {
            return new CaramelSweet();
        }

        public override AbstractSweet FactoryMethod(string name)
        {
            return new CaramelSweet(name);
        }

        public override AbstractSweet FactoryMethod(string name, double weight)
        {
            return new CaramelSweet(name, weight);
        }
    }

    public class CaramelInChololateCreator : CaramelCreator
    {
        public override AbstractSweet FactoryMethod()
        {
            return new CaramelInChololate();
        }

        public override AbstractSweet FactoryMethod(string name)
        {
            return new CaramelInChololate(name);
        }

        public override AbstractSweet FactoryMethod(string name, double weight)
        {
            return new CaramelInChololate(name, weight);
        }
    }

    public class ChocolateCreator : Creator
    {
        public override AbstractSweet FactoryMethod()
        {
            return new ChocolateSweet();
        }

        public override AbstractSweet FactoryMethod(string name)
        {
            return new ChocolateSweet(name);
        }

        public override AbstractSweet FactoryMethod(string name, double weight)
        {
            return new ChocolateSweet(name, weight);
        }
    }

    public class ChocolateWithWaffleCreator : ChocolateCreator
    {
        public override AbstractSweet FactoryMethod()
        {
            return new ChocolateWithWaffle();
        }

        public override AbstractSweet FactoryMethod(string name)
        {
            return new ChocolateWithWaffle(name);
        }

        public override AbstractSweet FactoryMethod(string name, double weight)
        {
            return new ChocolateWithWaffle(name, weight);
        }
    }
}